﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SecurityApi.DataAccess;
using SecurityApi.Business;

namespace SecurityApi.UnitTest
{
    [TestClass]
    public class RoleUnitTest
    {
        [TestCategory("Roles")]
        [TestMethod]
        public void GetUserRolesByUserId()
        {
            string userName = @"user1@codeplex.com";
            int userId = 1;
            int applicationId = 1;
            RoleManager mgr = new RoleManager();

            List<SecurityApi.Model.Role> apps = mgr.GetUserRoles(userId, applicationId);
            foreach (SecurityApi.Model.Role e in apps)
            {
                Debug.WriteLine(e.Name);
            }
        }

        [TestCategory("Roles")]
        [TestMethod]
        public void GetUserRolesByUserName()
        {
            string userName = @"user1@codeplex.com";
            int applicationId = 1;
            RoleManager mgr = new RoleManager();
            List<SecurityApi.Model.Role> apps = mgr.GetUserRoles(userName, applicationId);
            foreach (SecurityApi.Model.Role e in apps)
            {
                Debug.WriteLine(e.Name);
            }
        }


    }
}
